package com.bci.pwtz.mysql.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.bci.pwtz.mysql.model.CompanyUser;

public interface CompanyUserMapper {
    int deleteByPrimaryKey(Long companyUserId);

    int insert(CompanyUser record);

    int insertSelective(CompanyUser record);

    CompanyUser selectByPrimaryKey(Long companyUserId);

    int updateByPrimaryKeySelective(CompanyUser record);

    int updateByPrimaryKey(CompanyUser record);
    
    CompanyUser selectUserByUserInfo(@Param("tel") String tel,@Param("userPwd") String userPwd);
    
    int clearDeviceId(String deviceId);
    
    int selectCountByName(String userName);
    
    int selectCountByMobile(String mobile);
    
    int selectCountByPassword(@Param("pwd") String pwd,@Param("companyUserId") Long companyUserId);
    
    int updatePwdByMobile(@Param("pwd") String pwd,@Param("mobile") String mobile);
    
    List<CompanyUser> selectUserByRole(@Param("companyRoleId") Long companyRoleId,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);
    
    int selectCountUserByRole(@Param("companyRoleId") Long companyRoleId);
    
    List<CompanyUser> selectUserByLastCompanyId(@Param("companyRoleId") Long companyRoleId,@Param("lastCompanyId") Long lastCompanyId,@Param("loginname") String loginName,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);
    
    int selectCountUseByLastCompanyId(@Param("companyRoleId") Long companyRoleId,@Param("lastCompanyId") Long lastCompanyId,@Param("loginname") String loginName);
    
    List<CompanyUser> selectUserByCompanyId(@Param("companyId") Long companyId,
            @Param("benginIndex") int benginIndex, @Param("pageSize") int pageSize);
    
    List<CompanyUser> selectUserByCompanyIds(@Param("companyids") String[] companyids);
    
    int selectCountUseByCompanyId(@Param("companyId") Long companyId);
    
    int exitCompany(@Param("userId")Long companyUserId);
    
    List<CompanyUser> selectTmepUser( @Param("beginIndex") int beginIndex, @Param("pageSize") int pageSize);
     
    int selectTmepUserCount();
    
    int selectTmepUserById(Long userid);
    
    CompanyUser selectUser(@Param("userName") String userName,@Param("mobile") String mobile);
}